<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPageAdmin.master" AutoEventWireup="true" CodeFile="News_management.aspx.cs" Inherits="Admin_News_management" %>

<%@ Register assembly="FredCK.FCKeditorV2" namespace="FredCK.FCKeditorV2" tagprefix="FCKeditorV2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style9
        {
        }
        .style10
        {
            color: #3399FF;
            font-weight: bold;
        }
        .style11
        {
            color: #3399FF;
            font-weight: bold;
            text-align: right;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table class="style7">
        <tr>
            <td style="text-align: center">
                <asp:Label ID="Label9" runat="server" 
                    style="font-size: xx-large; font-weight: 700; color: #CC9900" 
                    Text="News Management"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" CellPadding="4" DataKeyNames="newsId" 
                    DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="Vertical" 
                    onselectedindexchanged="GridView1_SelectedIndexChanged">
                    <RowStyle BackColor="#EFF3FB" />
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" />
                        <asp:BoundField DataField="newsTitle" HeaderText="newsTitle" 
                            SortExpression="newsTitle" />
                        <asp:BoundField DataField="newsContent" HeaderText="newsContent" 
                            SortExpression="newsContent" />
                        <asp:CheckBoxField DataField="published" HeaderText="published" 
                            SortExpression="published" />
                        <asp:BoundField DataField="creatorld" HeaderText="creatorld" 
                            SortExpression="creatorld" />
                        <asp:BoundField DataField="createdDate" HeaderText="createdDate" 
                            SortExpression="createdDate" />
                        <asp:BoundField DataField="lastEditedUserId" HeaderText="lastEditedUserId" 
                            SortExpression="lastEditedUserId" />
                        <asp:BoundField DataField="lastEditedDate" HeaderText="lastEditedDate" 
                            SortExpression="lastEditedDate" />
                    </Columns>
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#2461BF" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    
                    SelectCommand="SELECT * FROM [tblNews]">
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td class="style9">
                <table class="style7">
                    <tr>
                        <td colspan="3" style="text-align: center">
                            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Add" 
                                style="width: 37px" />
                        &nbsp;
                            <asp:Button ID="Button4" runat="server" onclick="Button4_Click" Text="Edit" />
&nbsp;
                            <asp:Button ID="Button3" runat="server" onclick="Button3_Click" Text="Delete" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" style="text-align: center">
                            <asp:Label ID="Label8" runat="server" 
                                style="font-size: xx-large; font-weight: 700; color: #CC9900" Text="Edit" 
                                Visible="False"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="style11">
                            <asp:Label ID="Label1" runat="server" Text="Title" CssClass="style10" 
                                Visible="False"></asp:Label>
                        </td>
                        <td>
                            &nbsp;</td>
                        <td>
                            <asp:TextBox ID="txtTitle" runat="server" Visible="False"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style11" valign="top">
                            <asp:Label ID="Label2" runat="server" Text="Content" CssClass="style10" 
                                Visible="False"></asp:Label>
                        </td>
                        <td>
                            &nbsp;</td>
                        <td>
                            <FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server" Height="400px" 
                                Visible="False">
                            </FCKeditorV2:FCKeditor>
                        </td>
                    </tr>
                    <tr>
                        <td class="style11">
                            <asp:Label ID="Label3" runat="server" Text="Published" CssClass="style10" 
                                Visible="False"></asp:Label>
                        </td>
                        <td>
                            &nbsp;</td>
                        <td>
                            <asp:DropDownList ID="ddlPublish" runat="server" Visible="False">
                                <asp:ListItem Enabled="False"></asp:ListItem>
                                <asp:ListItem Value="0">Unpublished</asp:ListItem>
                                <asp:ListItem Value="1">Published</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="style11">
                            <asp:Label ID="Label6" runat="server" Text="Last edited user" 
                                CssClass="style10" Visible="False"></asp:Label>
                        </td>
                        <td>
                            &nbsp;</td>
                        <td>
                            <asp:DropDownList ID="ddlEditUser" runat="server" Visible="False">
                                <asp:ListItem></asp:ListItem>
                                <asp:ListItem Value="1">Administrator</asp:ListItem>
                                <asp:ListItem Value="2">Staff</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="style11" valign="top">
                            <asp:Label ID="Label7" runat="server" Text="Last edited date" 
                                CssClass="style10" Visible="False"></asp:Label>
                        </td>
                        <td>
                            &nbsp;</td>
                        <td>
                            <asp:Calendar ID="cldLastedit" runat="server" Visible="False"></asp:Calendar>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                        <td>
                        &nbsp;
                            <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="Update" 
                                Visible="False" />
                        &nbsp;
                            </td>
                    </tr>
                    </table>
            </td>
        </tr>
    </table>
</asp:Content>

